﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $cfg_sitename."-".$cfg_sysversion;?></title>
<meta name="viewport" content="width=device-width">
<link href="<?php echo YESHILITEMPLETS_SKIN;?>/css/login.css" rel="stylesheet" type="text/css">
</head>
<body>

<div class="login">
   <form action="#" method="post" id="js-form">
	<div class="logo"></div>
    <div class="login_form">
    	<div class="user">
        	<input class="text_value" value="" name="username" type="text" id="username" placeholder="用户帐号！">
            <input class="text_value" value="" name="password" type="password" id="password" placeholder="用户密码！">
        </div>
        <button class="button" id="submit" type="submit">登录</button>
    </div>
    <div id="js-tips"></div>
    </form>
</div>
</body>
</html>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
$(function(){
	$('#js-form').on('submit',function(){
		var status = true;
		var tips = '';
		var username = $('#username').val();
		var password = $('#password').val();
		var $tips = $('#js-tips');
		if(status){
		$.ajax({
			  url:"index-do.php?act=login&username="+username+"&password="+password,
			  dataType:"text",
			  type:"get",
			  success: function(data){
				  if(data==1){
					  window.location='admin.php';
				  }else{
					  tips = data;
					  $tips.text(tips).slideDown(200).delay(2000).slideUp(200);
				  }
			  }
		  });
		}
		return false;
	});
});	
</script>